package com.share.example.stock.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.share.example.stock.model.db.StrategyResult;
import com.share.example.stock.model.vo.StrategyCodeDateVo;
import com.share.example.stock.model.vo.StrategyCodeOneDay;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface StrategyMapper extends BaseMapper<StrategyResult> {
    int insertbatch(@Param("list") List<StrategyResult> list);

    int updateByCodeAndDate(@Param("record") StrategyResult record);

    @MapKey("code")
    Map<String, StrategyCodeOneDay> mapByDateAndStrategy(@Param("date") String date, @Param("strategy") String strategy);

    @MapKey("codeDate")
    Map<String, StrategyCodeDateVo> mapInDate(@Param("list") List<String> list);

    int updateByCode(@Param("record") StrategyResult record);
}
